<div class="box box-info">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
        <div class="box-tools">
            <div class="btn-group pull-right" style="margin-right: 10px">
                <a href="{{ route('categories.index') }}" class="btn btn-sm btn-default"><i class="fa fa-list"></i>
                    列表</a>
            </div>
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered">
            <tbody>
            <tr>
                <td>分类名：</td>
                <td colspan="3">{{ $category->name }}</td>
            </tr>
            <tr>
                <td>简介：</td>
                <td colspan="3">{{ $category->description }}</td>
            </tr>
            <tr>
                <td>图片：</td>
                <td colspan="3">
                    <img style="height:50px;" src="{{asset('storage/' . $category->image) }}">
                </td>
            </tr>
            <tr>
                <td rowspan="{{ $category->products->count() + 1 }}">商品:</td>
                <td>图片</td>
                <td>类型</td>
                <td>价格</td>
            </tr>
            @foreach($category->products as $product)
                <tr>
                    <td><img style="height:50px;" src="{{asset('storage/' . $product->image) }}"></td>
                    <td>{{ $product->name }}</td>
                    <td>{{ $product->price }}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
</div>